import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:get/get.dart';

import 'state.dart';

class AffirmPayPasswordLogic extends GetxController {
  final AffirmPayPasswordState state = AffirmPayPasswordState();

  validatePayPassword(String payPassword) {
    if (payPassword != state.lastInputPassword) {
      EasyLoading.showToast("两次输入的密码不一致");
      return;
    }
    EasyLoading.showToast("密码修改成功");
    Get.back();
  }

  @override
  void onInit() {
    // TODO: implement onInit
    super.onInit();
    if (Get.arguments != null) {
      state.lastInputPassword = Get.arguments['lastInputPassword'];
    }
  }

  @override
  void onClose() {
    // TODO: implement onClose
    super.onClose();
    state.payPasswordController.dispose();
  }
}
